<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>window对象</title>
</head>
<body>
<input type="button" value="后退" id="back">
<input type="button" value="前进" id="forward">
</body>
<script>
    // var w=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
    // var h=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;
    //
    // console.log(w + "::" + h) ;
    //
    // console.log("可用宽度: " + screen.availWidth);
    // console.log("可用高度: " + screen.availHeight);
    //可以获取 浏览器地址栏的路径
    // console.log(window.location.href);
    //改变地址栏路径
    // window.location.href = "https://www.baidu.com";

    document.getElementById("back").addEventListener("click",function(){
        window.history.back(); //后退一步
    });

    document.getElementById("forward").addEventListener("click",function(){
        window.history.forward(); //前进一步
    });
</script>
</html>